package com.health.circle.ui;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.RelativeLayout;

import com.health.circle.R;
import com.health.circle.base.BaseActivity;

public class FirstTabActivity extends BaseActivity implements OnClickListener {

	private RelativeLayout mRlSearchOffice, mRlSearchDrug, mRlSearchDiease;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.first_tab_activity);

		initView();
	}

	private void initView() {
		mRlSearchOffice = (RelativeLayout) findViewById(R.id.rl_search_office);
		mRlSearchOffice.setOnClickListener(this);

		mRlSearchDrug = (RelativeLayout) findViewById(R.id.rl_search_drug);
		mRlSearchDrug.setOnClickListener(this);

		mRlSearchDiease = (RelativeLayout) findViewById(R.id.rl_search_disease);
		mRlSearchDiease.setOnClickListener(this);
	}
	
	private void setSkipAnimation(){
		FirstTabActivity.this.getParent().overridePendingTransition(
				R.anim.push_left_in, R.anim.push_left_out);
	}
	
	private void goToLogin(){
		openActivity(LoginActivity.class);
		setSkipAnimation();
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.rl_search_office:
			goToLogin();
			break;
		case R.id.rl_search_drug:
			goToLogin();
			break;
		case R.id.rl_search_disease:
			goToLogin();
			break;

		default:
			break;
		}
	}

}
